package sctu.edu.java.year2016.team01.zhuming.day20160522.chapter4_3;

/**
 * Created by Administrator on 2016/5/24.
 */
public class QiuHe {
    static double fun(int n)
    {
        if(n<0)
           return -1;
        else if(n==0||n==1)
           return 1;
        else
        return fun((n-1))*n;
    }
    public static void main(String[] args) {

        double  sum = 0;
        for(int i=1;i<20;i++)

            sum=sum+1/fun(i);

        System.out.println("1+1/2!+1/3!....1/20!="+sum);

    }
}
